package cn.tedu.boot31.controller;

import cn.tedu.boot31.entity.Product;
import cn.tedu.boot31.mapper.ProductMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ProductController {
    @Autowired
    ProductMapper productMapper;

    @RequestMapping("/insert")
    public String insert(Product product){
        System.out.println("product = " + product);
        productMapper.insert(product);
        return "添加完成!<a href='/'>返回首页</a> ";
    }
}
